package com.schoolCommunity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import com.schoolCommunity.entity.Member;

import java.util.List;
import java.util.Set;
import java.util.function.LongFunction;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author YTH
 * @since 2020-09-06
 */
@Repository
public interface MemberMapper extends BaseMapper<Member> {


    //测试获取所有数据
    @Select("select * from member")
    public List<Member> getAllMembers();

    //获取所有用户邮箱，避免重复
    @Select("select email from member")
    public Set<String> getAllEmailsForSet();

    //获取最后插入的id，不适用高并发
    @Select("SELECT LAST_INSERT_ID()")
    public long GetLastId();


}
